package ooday01;
/** 学生类 */
public class  Student { //自己创造的一种数据类型
    //成员变量---描述对象的属性
    String name;
    int age;
    String className;
    String stuId;

    public Student() {
    }

    public Student(String name, int age, String className, String stuId) {
        this.name = name;
        this.age = age;
        this.className = className;
        this.stuId = stuId;
    }


    //方法------描述对象的T行为
    public void study(){
        System.out.println(this.name+"在学习...");
    }
    public void sayHi(){
        System.out.println("大家好，我叫"+this.name+"，今年"+this.age+"岁了，所在班级为"+
                           this.className+"，学号为:"+this.stuId);
    }
    public void playWith(String name){
        System.out.println(this.name+"正在和"+name+"一起玩...");
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return className
     */
    public String getClassName() {
        return className;
    }

    /**
     * 设置
     * @param className
     */
    public void setClassName(String className) {
        this.className = className;
    }

    /**
     * 获取
     * @return stuId
     */
    public String getStuId() {
        return stuId;
    }

    /**
     * 设置
     * @param stuId
     */
    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    public String toString() {
        return "Student{name = " + name + ", age = " + age + ", className = " + className + ", stuId = " + stuId + "}";
    }
}



















